package day67_interview_17;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @ClassName Solution
 * @Description TODO
 * @Author clockTown
 * @Date 2021/7/15 20:50
 * @Version 1.0
 */
public class Solution {
    public int[][] multiSearch(String big, String[] smalls) {

        int[][] res = new int[smalls.length][];
        for (int j = 0; j < smalls.length; j++) {
            List<Integer> list = new ArrayList<Integer>();
            for (int i = 0; i < big.length(); i ++){
                if ( big.startsWith(smalls[j], i) && !smalls[j].isEmpty()){
                    list.add(i);
                }
            }
            int[] temp = new int[list.size()];
            for (int i = 0; i < list.size(); i++) {
                temp[i] = list.get(i);
            }
            res[j] = temp;
        }

        return res;
    }

}
